﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>@ViewBag.Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="@Url.Content("~/Content/Images/Logo_icon.ico")" type="image/x-icon" />
	<link rel="stylesheet" href="@Url.Content("~/Content/cssFrontEnd/css/styles.css")" type="text/css" />
    <link rel="stylesheet" href="@Url.Content("~/Content/cssFrontEnd/css/styles-responsive.css")" type="text/css" />
  <script type="text/javascript" src="http://cdn.dev.skype.com/uri/skype-uri.js"></script>
    
       @if(ViewBag.MetaDescription != null)
    {
        <meta name="description" content="@ViewBag.MetaDescription" />
    }

    @if(ViewBag.MetaKeywords != null)
    {
        <meta name="keywords" content="@ViewBag.MetaKeywords" />
    }
    @RenderSection("occasionalScripts", false)
    <script type="text/javascript">
        $(document).ready(function () {
            //$('#frmLogin').show();
            $('.loginform button').hover(function () {
                $(this).stop().switchClass('default', 'hover');
            }, function () {
                $(this).stop().switchClass('hover', 'default');
            });
            $('#login').submit(function () {
                return false;
            });

            $('#Username').keypress(function () {
                jQuery('.loginerror').slideUp();
            });
            $('#errorlogin').hide();
            // tìm kiếm
            $('#search').keyup(function (event) {
                if (event.keyCode == 13) {
                    var getURL = '@Url.Action("Search", "Index")';
                    var searc = $('#search').val();
                    if (location.pathname == "/Index/Search") {
                        $.get(getURL, { "search": searc }, function (data) {
                            $("div#container").html(data);
                        });
                    }
                    else {
                        window.location.href = "../Index/Search?search="+searc;
                    }
            }
            });
            $('#Searchbutton').click(function () {
                var getURL = '@Url.Action("Search", "Index")';
                var searc = $('#search').val();
                if (location.pathname == "/Index/Search") {
                    $.get(getURL, { "search": searc }, function (data) {
                        $("div#container").html(data);
                    });
                }
                else {
                    window.location.href = "../Index/Search?search=" + searc;
                }
            });
            //setTimeout(DemTinnhan, 10000);

            var DemTinNhan = function() {
                var postURL = '@Url.Action("DemTinnhan", "Index")';
                $.post(postURL, function (data) {
                    $('#DemTN').text(data);
                });
                setTimeout(DemTinNhan, 10000); //5s
            };
            DemTinNhan();
    });
    
      
    function checkId() {

        var Username = $('#Username').val();
        var Pass = $('#Pass').val();
        var CheckR = kiemtracheckbox();
        var postURL = '@Url.Action("CheckId", "LoginUser")';
        //         $.post("/Admin/Login/CheckId", { "Username": Username, "Pass": Pass }, function (data) {

        $.post(postURL, { "Username": Username, "Pass": Pass, "Remember": CheckR }, function (data) {
            if (data.Status == 2) {
                window.location.href = "@Url.Action("Ban", "LoginUser")"
            }
            else if (data.Status == 0) {
                window.location.href = "@Url.Action("ChuaKH", "LoginUser")"
            }
            else if (data.Status == 3) {
                window.location.href = "@Url.Action("Xoa", "LoginUser")"
            }
            else if (data.Status == 4) // ko dung pass hoac user
            {
                $('#errorlogin').show();

            }
            else {
                $('#errorlogin').hide();
                window.location.href = "@Url.Action("Index", "Index")"
            }
        });
    };

function kiemtracheckbox() {
    if ($('#remember').is(":checked")) {
        return true;
    }
    else {
        return false;
    }

};

</script>


</head>


<body class="no-js home">
    <div class="no-js-msg">
       @* <div class="inner-no-js">

            <img src="Content/cssFrontEnd/images/logo.png" alt="" /><br />

            Vui lòng kích hoạt Javascript để xem website. Cảm ơn bạn!<br />
            <small>(Please enable Javascript to review this website. Thank you!)</small>
        </div>*@
    </div>
    <div class="loading">
    </div>
    <!--/ .loading-->
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <button type="button" class="btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="brand" href='@Url.Action("Index", "Index")'>
                    <img src="@Url.Content("~/Content/cssFrontEnd/images/Logo_web_2.png")" alt="" /></a>
                <div class="nav-collapse collapse">
                    <ul class="nav">
                         @{
                             if (System.Web.HttpContext.Current.Request.Cookies["userId"] != null && System.Web.HttpContext.Current.Request.Cookies["UserType"].Value == "2")
                            {
                                     <li><a href="http://yeuquangcao.com/#!ads" rel="ads">Quảng cáo của bạn</a></li>
                            }
                            else
                            {
                                      <li><a href="http://yeuquangcao.com/#!ads" rel="ads">Xem Quảng Cáo</a></li>
                            }
                        }
                   
                        @{
                            if (System.Web.HttpContext.Current.Request.Cookies["userId"] != null)
                            {
                                    <li id ="TaiKhoanCuaBan"><a href="http://yeuquangcao.com/#!account" rel="account">Tài khoản của bạn</a></li>   
                            }
                        }
                        <li><a href="http://yeuquangcao.com/#!guide" rel="guide">Hướng dẫn</a></li>
                    </ul>
                    <div class="profile">
                       
                        <div>
                           <span  class="input"> <input type="text" id ="search" name="search" placeholder="Tìm kiếm..." />
                            <a href="#" class="inputn" id="Searchbutton">&nbsp;</a></span>
                        </div>
                        
                            
                        <div class="profile-inner">
                            @{
                                if (System.Web.HttpContext.Current.Request.Cookies["userId"] != null)
                                {
                                    if (System.Web.HttpContext.Current.Request.Cookies["UserAvatar"].Value != "")
                                    {
                                        string v = "~/Content/Images/Avatar/" + System.Web.HttpContext.Current.Request.Cookies["UserAvatar"].Value;
                                        <img src="@Url.Content(v)" alt="Img" width ="36" height="36"/>
                                    }
                                    else
                                    {
                                        <img src="@Url.Content("~/Content/cssFrontEnd/Images/avatar.jpg")" alt="" width ="36", height="36"/>
                                    }
                                }
         
                            }

                            <div class="line">
                                @{
                                    if (System.Web.HttpContext.Current.Request.Cookies["userId"] != null)
                                    {
                                        if (Request.Cookies["UserType"].Value == "2")
                                        {
                                             <p class="line1">@Html.ActionLink(Request.Cookies["UserId"].Value, "InfoUser", "Organization")</p>
                                            <input type ="hidden" class ="getUserNameOr" value="@Request.Cookies["UserId"].Value"/>
                                        }
                                        else
                                        {
                                            <p class="line1">
                                                <a href="#frmChat" role="button" data-toggle="modal" class="pull-right icon-chat">
                            	                    <span ><img src="/Content/Images/icon-sendmsg.png" /></span>
                                                    @*@{
                                                        if (Request.Cookies["SoLuongTinNhan"] != null)
                                                        {
                                                            <span class="badge badge-warning">@Request.Cookies["SoLuongTinNhan"].Value</span>
                                                        }
                                                        else
                                                        {
                                                             <span class="badge badge-warning">0</span>
                                                        }
                                                    }*@
                                                     <span class="badge badge-warning" id ="DemTN">0</span>
                                                    
                                                   
                                                </a>
                                                
                                                <a href="@Url.Action("ThongTinCaNhan", "Individual", new { Friend = System.Web.HttpContext.Current.Request.Cookies["userId"].Value }, null)" role="button" data-toggle="modal">@Request.Cookies["UserId"].Value </a>
                                            @Html.Action("Diemvideo", "Individual") &nbsp;
                                            </p>
                                        }
                                    
                                    <p class="line2">@Html.ActionLink("Thoát", "logout", "LoginUser")</p>
                                    }
                                    else
                                    {
                                    <p class="line1"><a href="#frmLoginn" role="button" data-toggle="modal">Đăng nhập</a></p>
                                    <p class="line2">@Html.ActionLink("Đăng ký", "DangKy", "LoginUser") </p>
                                    }
                                }
                            </div>
                        </div>
                        <!--/ .profile-inner-->
                    </div>
                    <!--/ .profile-->
                </div>
                <!--/.nav-collapse -->
            </div>
            <!--/ .container-->
        </div>
        <!--/ .navbar-inner-->
    </div>
    <!--/ .navbar-->
    <div id="container">
        @RenderBody()
    </div>
    <!--/ #container-->
    <div id="footer" class="navbar-fixed-bottom">
        <div class="ft-support pull-left">
            <button type="button" class="btn-navbar" data-toggle="collapse" data-target=".nav-pills">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <button data-toggle="collapse" data-target=".ft-support-inner">Hỗ trợ</button>
           @Html.Action("HoTro", "Index")
           
            <!--/ .ft-support-inner-->
        </div>
        <!--/ ft-support-->

        <ul class="nav-pills nav pull-left">
            <li>@Html.ActionLink("Giới thiệu", "GioiThieu", "NSiteInfo")</li>
            <li>@Html.ActionLink("Liên hệ", "LienHe", "NSiteInfo")</li>
            <li>@Html.ActionLink("Tin Tức", "Index", "TinTuc", new { IdType = 1 }, null)</li>
            <li>@Html.ActionLink("Điều khoản dịch vụ", "DieuKhoanDichVu", "NSiteInfo")</li>
            <li>@Html.ActionLink("Chính sách bảo mật", "ChinhSachBaoMat", "NSiteInfo")</li>
            <li>@Html.ActionLink("Câu hỏi thường gặp", "FAQ", "NSiteInfo")</li>
        </ul>
        <div class="copyright pull-right">
            <div class="social pull-left">
                <a href="https://www.facebook.com/videoadspro" class="facebook">Facebook</a>
                <a href="http://twitter.com" class="twitter">Twitter</a>
            </div>
            <!--/ .social-->
            <div class="copy  pull-left">
                <p>Copyright © 2011 <a href="yeuquangcao.vn">yeuquangcao.vn</a></p>
                <small class="visible-desktop"><a href="@Url.Action("Index", "Login", new { area = "Admin" })" >yeuquangcao.com</a> chạy nhanh và tốt nhất trên trình duyệt <a href="http://www.google.com/intl/vi/chrome/">Chrome</a> hoặc <a href="http://www.mozilla.org/vi/firefox/new/">Firefox</a></small>
            </div>
            <!--/ .copy-->
        </div>
        <!--/ .copyright-->
    </div>
    <!--/ #footer-->
    <!-- frmLogin -->
    <div id="frmLoginn" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3><b>ĐĂNG NHẬP</b></h3>
        </div>
        <div class="modal-body">
 
            <div class="form-horizontal" style="font-size:18px !important; font-family:Arial !important;">
               <form id="login" action="" method="post">
                    <div class="control-group">
                        <label class="control-label" for="inputUser"><b>Tên đăng nhập</b></label>
                        <div class="controls">
                            <input type="text" id="Username" name="Username" placeholder="User" />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="inputPassword"><b>Mật khẩu</b></label>
                        <div class="controls">
                            <input type="password" id="Pass" name="Pass" placeholder="Password" />
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <label class="checkbox">
                                <input type="checkbox" id ="remember" />
                               <b>Nhớ đăng nhập</b>  | <a href="@Url.Action("QuenMatKhau", "LoginUser")"><b>Quên mật khẩu</b></a>
                            </label>
                          
                                @using (Html.BeginForm())
                                {
                                <button type="submit" class="btn" id="checkid" onclick="checkId()">Sign in</button>
                    
                                }
                             | @Html.ActionLink("Đăng ký", "DangKy", "LoginUser")
                             <div id ="errorlogin" style ="color:red;">Tên đang nhập hoặc mật khẩu không đúng</div>
                        </div>
                       
                    </div>
                    <//form>
            </div>
               
        </div>

    </div>

      <div id="frmERROR" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3><b>Thông báo</b></h3>
        </div>
        <div class="modal-body">
            <br />
           <div style="color:red; font-size: 20px;" id="MatKhauError"></div>
          
            <br />
               
        </div>

    </div>

     <div id="frmconfirm" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3><b>Thông báo</b></h3>
        </div>
        <div class="modal-body">
       
            <br />
           <div style="font-size: 20px;" id="confirm"></div>
            <br />
              <button type ="button" class ="btn-success pull-right" data-dismiss="modal" aria-hidden="true">Hủy bỏ</button> 
             <button type="button"  onclick="return check();" class ="btn-danger pull-right" data-dismiss="modal" aria-hidden="true">Đồng ý</button>
            
               
        </div>

    </div>

     @Html.Action("DSTinNhan", "Individual")

    <!-- --- popup ------>
<style type="text/css">
    #floating
    {
        z-index: 9999999;
        position: absolute;
        width: 600px;
        height: 420px;
        border: 0px !important;
    }
    #overPage
    {
        background: black;
        z-index: 9999999;
        position: absolute;
        left: 0;
        top: 0;
    }
</style>
 @{
     if (System.Web.HttpContext.Current.Request.Cookies["userId"] != null) {
     
       @Html.Action("QuangCao", "Index")
 }
 }   
</body>
</html>
